class LoadingScene extends BaseScene implements RES.PromiseTaskReporter {

    private progressLbl:eui.Label;
    private progressGroup:eui.Group;
    private progressMask:egret.Shape;
    public constructor(index: number = GameConfig.uiIndex.load) {
        super(index);
        this.skinName="LoadingSceneSkin";
    }
    public onChildrenCreated(): void {
        super.onChildrenCreated();
        // 进度条设置
        this.progressMask = new egret.Shape();
        this.progressGroup.parent.addChild(this.progressMask);
        this.progressGroup.mask = this.progressMask;

    }

    /**
     * 进度回调
     */
    public onProgress(current: number, total: number){
        let persent = current/total;
        this.progressLbl.text =  "正在加载中..."+Math.floor(persent*100)+"%";
        this.progressMask.graphics.clear();
        this.progressMask.graphics.beginFill(0xffffff,1);
        this.progressMask.graphics.drawRoundRect(4,3,this.progressGroup.width*persent,this.progressGroup.height,10,10);
    }
    /**
     * 取消回调
     */
    public onCancel(){

    }
}
